// 引入请求
import request from "../../utils/request";

// 使用枚举列出接口
enum API {
    // 获取个人信息的数据
    // https://www.dance365.com/apis/userCenter/users/me?access_token=93b69bf1-9a53-4639-8866-baa988967d23
    // 获取会员信息
    // https://www.dance365.com/apis/setup/setups/search/findByGroupType?access_token=93b69bf1-9a53-4639-8866-baa988967d23&groupType=vip_product
    // https://www.dance365.com/apis/setup/setups/search/findByGroupType?
    // 参数:access_token=93b69bf1-9a53-4639-8866-baa988967d23  和groupType=vip_product
    // 获取技能水平的请求
    // 地址:https://www.dance365.com/apis/setup/setups/search/findByGroupType?groupType=skill_level&access_token=93b69bf1-9a53-4639-8866-baa988967d23


    // 点击保存的时候发的请求
    // 地址:https://www.dance365.com/apis/userCenter/users/ff80808183ede03d0183eec869b543ac?access_token=93b69bf1-9a53-4639-8866-baa988967d23
    // 请求方式是:patch
    // 请求参数是:avatar
    
    ACCESSTOKEN = '5fd27fe7-8cad-4ed7-a5cf-eede1f6adcce',
    // ACCESSTOKEN  = '5fd27fe7-8cad-4ed7-a5cf-eede1f6adcce',

    // 个人信息
    USERINFO = '/userCenter/users/me?access_token=',
    // 会员信息和 技能水平的数据
    MEMBERDATA = '/setup/setups/search/findByGroupType?',
    // 个人信息保存
    INFORMATIONSave = '/userCenter/users/ff80808183ede03d0183eec869b543ac?access_token='
}
export const reqUserInfo = () => request.get(API.USERINFO + API.ACCESSTOKEN)
export const reqMemberData = (groupType: string | number) => request.get(API.MEMBERDATA + 'access_token=' + API.ACCESSTOKEN + `&groupType=${groupType}`)
// 获取技能水平的数据
export const reqSkillLevel = (groupType: string) => request.get(API.MEMBERDATA + 'groupType=' + `${groupType}&` + 'access_token=' + API.ACCESSTOKEN)
// 个人资料保存时候发送到请求
export const reqInforMationSave = (data:any)=>request.patch(API.INFORMATIONSave + API.ACCESSTOKEN,data)


